package com.air.ota.service.imp;

import org.springframework.beans.factory.annotation.Autowired;

import com.air.common.util.QueryCondition4Update;
import com.air.common.util.QueryExpression;
import com.air.ota.service.IOutboundMsgService;

public abstract class BaseUplinkMsgHandler {
	
	@Autowired
	IOutboundMsgService outboundMsgService;
	
	protected void unlockRetryOutboundMsg(Integer transId,String msgType){
		QueryCondition4Update condition4Update= new QueryCondition4Update();
		condition4Update.addUpdateFieldExpression("needRetry", 0);
		condition4Update.addQueryCondition("needRetry", 1, QueryExpression.EQUALS);
		condition4Update.addQueryCondition("msgType", msgType, QueryExpression.EQUALS);
		condition4Update.addQueryCondition("transId", transId, QueryExpression.EQUALS);
		
		outboundMsgService.updateByCondition(condition4Update);
		
	}
	
}
